package p10.code.exchanger;


import java.util.List;
import java.util.concurrent.Exchanger;

public class Main {

    public static void main(String[] args) {

        Exchanger<List<Integer>> exchanger = new Exchanger<>();

        Thread t1 = new Thread(new Consumer(exchanger), "消费者-t1");
        Thread t2 = new Thread(new Producer(exchanger), "生产者-t2");

        t1.start();
        t2.start();
    }
}
